import request from '@/utils/request'

// 查询货转关联列表
export function listRelate(query) {
  return request({
    url: '/transfers/relate/list',
    method: 'get',
    params: query
  })
}

// 查询货转关联详细
export function getRelate(goodsTransferId) {
  return request({
    url: '/transfers/relate/' + goodsTransferId,
    method: 'get'
  })
}

// 新增货转关联
export function addRelate(data) {
  return request({
    url: '/transfers/relate',
    method: 'post',
    data: data
  })
}

// 修改货转关联
export function updateRelate(data) {
  return request({
    url: '/transfers/relate',
    method: 'put',
    data: data
  })
}

// 删除货转关联
export function delRelate(goodsTransferId) {
  return request({
    url: '/transfers/relate/' + goodsTransferId,
    method: 'delete'
  })
}

// 新增货转关联
export function addRelateExt(goodsIds, goodsTransferId) {
  return request({
    url: '/transfers/relate/ext/' + goodsIds + '/' + goodsTransferId,
    method: 'post',
//    data: data
  })
}

// 删除货转关联
export function delRelateExt(goodsIds, goodsTransferId) {
  return request({
    url: '/transfers/relate/ext/' + goodsIds + '/' + goodsTransferId,
    method: 'delete'
  })
}
